<admintpl file="header" />
</head>
<body>
<div class="wrap">
	<ul class="nav nav-tabs">
		<!-- <li class="active"><a href="{:U('com/index')}">{:L('COM_INDEX')}</a></li>
		<li><a href="{:U('com/add')}">{:L('COM_ADD')}</a></li> -->
		<li class="active"><a>借支管理</a></li>
	</ul>
	<form class="well form-search" method="post" action="{:U('borrow/index')}">
		企业名称：
		<input type="text" name="com_name" style="width: 20%;" value="{:I('request.com_name/s','')}" placeholder="请输入企业名称">
		借支状态：
		{$borrow_state}
		<input type="submit" class="btn btn-primary" value="搜索" />
		<a class="btn btn-danger" href="{:U('borrow/index')}">清空</a>
	</form>
	<form method="post" class="js-ajax-form">
		<table class="table table-hover table-bordered">
			<thead>
			<tr>
				<th align="center">ID</th>
				<th>企业名称</th>
				<th>员工姓名</th>
				<th>借支金额</th>
				<th>提交时间</th>
				<th>审核时间</th>
				<th>审核者</th>
				<th>打款时间</th>
				<th>打款管理员</th>
				<th>打款类型</th>
				<th>状态</th>
				<th align="center">操作</th>
			</tr>
			</thead>
			<tbody>
			<foreach name="list" item="vo">
				<tr>
					<td align="center">{$vo.id}</td>
					<td>{$vo.com_name}</td>
					<td> {$vo.personname} </td>
					<td> {$vo.num} </td>
					<td>{$vo.requestdate|date="Y-m-d",###}</td>
					<td>
						<notempty name="vo.confirmtime">
						           {$vo.confirmtime|date="Y-m-d",###}
						</notempty>
					</td>
					<td>
					    {$vo.confirmname|default=""}
					</td>
					<td>
					    <notempty name="vo.pmoneytime">
					         {$vo.pmoneytime|date="Y-m-d",###}
					    </notempty>
					</td>
					<td>
					   {$vo.pmoneyname|default=""}
					</td>
					<td>
						{:C('PAYMONEY_TYPE')[$vo['type']]['dict_text']}
					</td>
					<td>
						{:C('BORROW_TYPE')[$vo['state']]['dict_text']}
					</td>
					<td align="center">
					     <eq name="vo.state" value="1">
					             <a href="{:U('borrow/edit_state',array('id'=>$vo['id'],'state'=>2))}" class="js-ajax-delete" data-msg="确定员工在职吗？">员工在职</a> | 
								<a href="{:U('borrow/edit_state',array('id'=>$vo['id'],'state'=>3))}" class="js-ajax-delete" data-msg="确定员工不在职吗？">员工已离职</a>
						</eq>
						<eq name="vo.state" value="2">
						       <a href="{:U('borrow/edit_state',array('id'=>$vo['id'],'state'=>4))}" class="js-ajax-delete" data-msg="确定已经打款成功了吗？">打款完成</a>
						</eq>
						<eq name="vo.state" value="3">员工已离职</eq>
						<eq name="vo.state" value="4">借支已完成</eq>
					</td>
				</tr>
			</foreach>
			</tbody>
		</table>
		<div class="pagination">{$page}</div>
	</form>
</div>
<script src="__PUBLIC__/js/common.js"></script>
</body>
</html>